package com.eims.main.livescores.fragment;

import java.util.ArrayList;
import java.util.List;

import com.contans.view.BifenGetBaskBallTeamVo;
import com.contans.view.getINdexBaskballdayVo;
import com.eims.sls_app.utils.LotteryUtils;

import android.content.Context;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseExpandableListAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import bls.juejin.cn.R;

//为ExpandableListView自定义适配器
public class MyBaskExpandableListView extends BaseExpandableListAdapter {
	private Context context;
	private List<getINdexBaskballdayVo> maplist;
	private ArrayList<BifenGetBaskBallTeamVo> arrayList;

	// Model：定义的数据
	// private String[] groups = { "A", "B", "C" };
	// // 注意，字符数组不要写成{{"A1,A2,A3,A4"}, {"B1,B2,B3,B4，B5"}, {"C1,C2,C3,C4"}}*/
	// private String[][] childs = { { "A1", "A2", "A3", "A4" }, { "A1", "A2", "A3",
	// "B4" }, { "A1", "A2", "A3", "C4" } };
	public MyBaskExpandableListView(Context context, List<getINdexBaskballdayVo> maplist) {
		super();
		this.maplist = maplist;
		this.context = context;

	}

	public List<getINdexBaskballdayVo> getMaplist() {
		return maplist;
	}

	public void setMaplist(List<getINdexBaskballdayVo> maplist) {
		this.maplist = maplist;
	}

	// 返回一级列表的个数
	@Override
	public int getGroupCount() {
		if (maplist != null) {
			return maplist.size();
		}
		return 0;
	}

	// 返回每个二级列表的个数
	@Override
	public int getChildrenCount(int groupPosition) { // 参数groupPosition表示第几个一级列表
		Log.d("smyhvae", "-->" + groupPosition);
		if (maplist.get(groupPosition).getBallarrayList() != null) {
			return maplist.get(groupPosition).getBallarrayList().size();
		}
		return 0;
	}

	// 返回一级列表的单个item（返回的是对象）
	@Override
	public Object getGroup(int groupPosition) {
		return maplist.get(groupPosition);
	}

	// 返回二级列表中的单个item（返回的是对象）
	@Override
	public Object getChild(int groupPosition, int childPosition) {
		return maplist.get(groupPosition).getBallarrayList().get(childPosition); // 不要误写成groups[groupPosition][childPosition]
	}

	@Override
	public long getGroupId(int groupPosition) {
		return groupPosition;
	}

	@Override
	public long getChildId(int groupPosition, int childPosition) {
		return childPosition;
	}

	// 每个item的id是否是固定？一般为true
	@Override
	public boolean hasStableIds() {
		return true;
	}

	// 【重要】填充一级列表
	@Override
	public View getGroupView(int groupPosition, boolean isExpanded, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			holder = new ViewHolder();
			convertView = LayoutInflater.from(context).inflate(R.layout.caidan_one, null);
			holder.tv_tile = (TextView) convertView.findViewById(R.id.tv_tile);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}

		if (maplist.get(groupPosition).getTime().equals("over")) {
			holder.tv_tile.setText("完场");
		} else {
			holder.tv_tile.setText(maplist.get(groupPosition).getTime());
		}

		return convertView;
	}

	class ViewHolder {

		TextView tv_tile;

	}

	// 【重要】填充二级列表
	@Override
	public View getChildView(int groupPosition, int childPosition, boolean isLastChild, View view, ViewGroup parent) {

		final BifenGetBaskBallTeamVo ballTeamVo = maplist.get(groupPosition).getBallarrayList().get(childPosition);

		childViewHolder holder;
		// 判断View是否为空
		if (view == null) {
			holder = new childViewHolder();

			view = LayoutInflater.from(context).inflate(R.layout.fragment_lq_bifen_item, null);
			holder.tv_team_changci = (TextView) view.findViewById(R.id.tv_team_changci);

			holder.tv_team_type = (TextView) view.findViewById(R.id.tv_team_type);
			holder.tv_start_time = (TextView) view.findViewById(R.id.tv_start_time);
			holder.tv_time_statu = (TextView) view.findViewById(R.id.tv_time_statu);
			holder.tv_ing_type = (TextView) view.findViewById(R.id.tv_ing_type);

			holder.tv_gues_name = (TextView) view.findViewById(R.id.tv_gues_name);
			holder.tv_gues_bifen_1 = (TextView) view.findViewById(R.id.tv_gues_bifen_1);
			holder.tv_gues_bifen_2 = (TextView) view.findViewById(R.id.tv_gues_bifen_2);
			holder.tv_gues_bifen_3 = (TextView) view.findViewById(R.id.tv_gues_bifen_3);
			holder.tv_gues_bifen_4 = (TextView) view.findViewById(R.id.tv_gues_bifen_4);
			holder.tv_gues_bifen_5 = (TextView) view.findViewById(R.id.tv_gues_bifen_5);
			holder.tv_gues_bifen_total = (TextView) view.findViewById(R.id.tv_gues_bifen_total);

			holder.tv_main_name = (TextView) view.findViewById(R.id.tv_main_name);
			holder.tv_main_jiafen = (TextView) view.findViewById(R.id.tv_main_jiafen);
			holder.tv_main_bifen_1 = (TextView) view.findViewById(R.id.tv_main_bifen_1);
			holder.tv_main_bifen_2 = (TextView) view.findViewById(R.id.tv_main_bifen_2);
			holder.tv_main_bifen_3 = (TextView) view.findViewById(R.id.tv_main_bifen_3);
			holder.tv_main_bifen_4 = (TextView) view.findViewById(R.id.tv_main_bifen_4);
			holder.tv_main_bifen_5 = (TextView) view.findViewById(R.id.tv_main_bifen_5);
			holder.tv_main_bifen_total = (TextView) view.findViewById(R.id.tv_main_bifen_total);

			holder.lr_time_statu = (LinearLayout) view.findViewById(R.id.lr_time_statu);
			holder.lr_time_ing = (LinearLayout) view.findViewById(R.id.lr_time_ing);

			view.setTag(holder);
		} else {
			holder = (childViewHolder) view.getTag();
		}

		holder.tv_team_changci.setText(getTeamChangci(ballTeamVo.getXid()));
		holder.tv_team_type.setText(ballTeamVo.getLeague());
		holder.tv_gues_name.setText(ballTeamVo.getAteam());

		holder.tv_main_name.setText(ballTeamVo.getHteam());
		holder.tv_main_jiafen.setText(ballTeamVo.getLetscore());
		String teamStatu = ballTeamVo.getState();

		if (teamStatu.equals("0")) {
			holder.tv_start_time.setText(LotteryUtils.getStrTimebytimestamp(ballTeamVo.getMtime()));
			holder.tv_start_time.setVisibility(View.VISIBLE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.VISIBLE);
			holder.lr_time_ing.setVisibility(View.GONE);
			holder.tv_gues_bifen_1.setText("");
			holder.tv_gues_bifen_2.setText("");
			holder.tv_gues_bifen_3.setText("");
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText("");
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText("");
			holder.tv_main_bifen_2.setText("");
			holder.tv_main_bifen_3.setText("");
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText("");
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		} else if (teamStatu.equals("11")) {
			holder.tv_start_time.setText(LotteryUtils.getStrTimebytimestamp(ballTeamVo.getMtime()));
			holder.tv_start_time.setVisibility(View.VISIBLE);
			holder.tv_time_statu.setVisibility(View.VISIBLE);
			holder.lr_time_statu.setVisibility(View.VISIBLE);
			holder.lr_time_ing.setVisibility(View.GONE);

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText(ballTeamVo.getA4());
			holder.tv_gues_bifen_5.setText(ballTeamVo.getA5());
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText(ballTeamVo.getH4());

			holder.tv_main_bifen_5.setText(ballTeamVo.getH5());
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		} else if (teamStatu.equals("9")) {
			holder.tv_start_time.setText(LotteryUtils.getStrTimebytimestamp(ballTeamVo.getMtime()));
			holder.tv_start_time.setVisibility(View.VISIBLE);
			holder.tv_time_statu.setVisibility(View.VISIBLE);
			holder.lr_time_statu.setVisibility(View.VISIBLE);
			holder.lr_time_ing.setVisibility(View.GONE);

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText(ballTeamVo.getA4());
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText(ballTeamVo.getH4());

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		} else if (teamStatu.equals("1")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			
			if (ballTeamVo.getLtime()!=null&&!ballTeamVo.getLtime().equals("")) {
				holder.tv_ing_type.setText("第一节   "+ballTeamVo.getLtime());
			}else {
				holder.tv_ing_type.setText("第一节       ");
			}
			

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText("");
			holder.tv_gues_bifen_3.setText("");
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText("");
			holder.tv_main_bifen_3.setText("");
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));
		} else if (teamStatu.equals("3")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			if (ballTeamVo.getLtime()!=null&&!ballTeamVo.getLtime().equals("")) {
				holder.tv_ing_type.setText("第二节   "+ballTeamVo.getLtime());
			}else {
				holder.tv_ing_type.setText("第二节       ");
			}

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText("");
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText("");
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));
		} else if (teamStatu.equals("5")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			if (ballTeamVo.getLtime()!=null&&!ballTeamVo.getLtime().equals("")) {
				holder.tv_ing_type.setText("第三节   "+ballTeamVo.getLtime());
			}else {
				holder.tv_ing_type.setText("第三节       ");
			}

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));
		} else if (teamStatu.equals("7")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			if (ballTeamVo.getLtime()!=null&&!ballTeamVo.getLtime().equals("")) {
				holder.tv_ing_type.setText("第四节   "+ballTeamVo.getLtime());
			}else {
				holder.tv_ing_type.setText("第四节       ");
			}

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText(ballTeamVo.getA4());
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText(ballTeamVo.getH4());

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));
		} else if (teamStatu.equals("10")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			holder.tv_ing_type.setText("加时   13:30");

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText(ballTeamVo.getA4());
			holder.tv_gues_bifen_5.setText(ballTeamVo.getA5());
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText(ballTeamVo.getH4());

			holder.tv_main_bifen_5.setText(ballTeamVo.getH5());
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_bifen_yanqi));
		} else if (teamStatu.equals("2")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			holder.tv_ing_type.setText("第一节   结束");

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText("");
			holder.tv_gues_bifen_3.setText("");
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText("");
			holder.tv_main_bifen_3.setText("");
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		} else if (teamStatu.equals("4")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			holder.tv_ing_type.setText("第二节   结束");

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText("");
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText("");
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		} else if (teamStatu.equals("6")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			holder.tv_ing_type.setText("第三节   结束");

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		}  else if (teamStatu.equals("8")) {

			holder.tv_start_time.setVisibility(View.GONE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.GONE);
			holder.lr_time_ing.setVisibility(View.VISIBLE);
			holder.tv_ing_type.setText("第四节   结束");

			holder.tv_gues_bifen_1.setText(ballTeamVo.getA1());
			holder.tv_gues_bifen_2.setText(ballTeamVo.getA2());
			holder.tv_gues_bifen_3.setText(ballTeamVo.getA3());
			holder.tv_gues_bifen_4.setText(ballTeamVo.getA4());
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText(ballTeamVo.getAscore());
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText(ballTeamVo.getH1());
			holder.tv_main_bifen_2.setText(ballTeamVo.getH2());
			holder.tv_main_bifen_3.setText(ballTeamVo.getH3());
			holder.tv_main_bifen_4.setText(ballTeamVo.getH4());

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText(ballTeamVo.getHscore());
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		}else {
			holder.tv_start_time.setText(LotteryUtils.getStrTimebytimestamp(ballTeamVo.getMtime()));
			holder.tv_start_time.setVisibility(View.VISIBLE);
			holder.tv_time_statu.setVisibility(View.GONE);
			holder.lr_time_statu.setVisibility(View.VISIBLE);
			holder.lr_time_ing.setVisibility(View.GONE);
			holder.tv_gues_bifen_1.setText("");
			holder.tv_gues_bifen_2.setText("");
			holder.tv_gues_bifen_3.setText("");
			holder.tv_gues_bifen_4.setText("");
			holder.tv_gues_bifen_5.setText("");
			holder.tv_gues_bifen_total.setText("");
			holder.tv_gues_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));

			holder.tv_main_bifen_1.setText("");
			holder.tv_main_bifen_2.setText("");
			holder.tv_main_bifen_3.setText("");
			holder.tv_main_bifen_4.setText("");

			holder.tv_main_bifen_5.setText("");
			holder.tv_main_bifen_total.setText("");
			holder.tv_main_bifen_total.setTextColor(context.getResources().getColor(R.color.main_red));
		}

		return view;
	}

	class childViewHolder {
		ImageView iv_Head;
		TextView tv_team_changci, tv_team_type, tv_start_time, tv_time_statu, tv_ing_type;
		TextView tv_gues_name, tv_gues_bifen_1, tv_gues_bifen_2, tv_gues_bifen_3, tv_gues_bifen_4, tv_gues_bifen_5,
				tv_gues_bifen_total;
		TextView tv_main_name, tv_main_jiafen, tv_main_bifen_1, tv_main_bifen_2, tv_main_bifen_3, tv_main_bifen_4,
				tv_main_bifen_5, tv_main_bifen_total;
		LinearLayout lr_time_statu, lr_time_ing;

	}

	// 二级列表中的item是否能够被选中？可以改为true
	@Override
	public boolean isChildSelectable(int groupPosition, int childPosition) {
		return true;
	}

	public String getTeamChangci(String strChangci) {

		String weeknum = "20" + strChangci.substring(0, strChangci.length() - 3);
		String teamNum = strChangci.substring(strChangci.length() - 3, strChangci.length());
		String weekString = "";

		try {
			weekString = LotteryUtils.getTeamWeekOfDate(weeknum);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return weekString + teamNum;
	}
}